<template>
  <div>
    <NavMenu></NavMenu>
    <el-table :data="tableData" stripe style="width: 100%">
      <el-table-column prop="send" label="留言用户" width="180">
      </el-table-column>
      <el-table-column prop="phone" label="电话" width="180">
      </el-table-column>
      <el-table-column prop="email" label="邮件地址" width="180">
      </el-table-column>
      <el-table-column prop="job" label="职位" width="300">
      </el-table-column>
      <el-table-column prop="comments" label="留言" width="500">
      </el-table-column>
    </el-table>
  </div>
</template>

<script>
import NavMenu from "@/components/NavMenu";
import ajax from "@/components/ajax";
export default {
  name: "Info",
  data() {
    return {
      tableData: []
    };
  },
  methods: {},
  beforeMount: function() {
    const that = this;
    ajax({
      method: "get",
      url: "http://127.0.0.1:3000/getComments",
      withCredentials: true,
      success: function(res) {
        // console.log(res);
        // if(){}
        that.tableData = res.data;
      }
    });
  },
  components: {
    NavMenu
  }
};
</script>

<style>
#app {
  font-family: "Avenir", Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
  /* margin-top: 60px; */
}
</style>
